<template>
  <div class="loading_cover_container" v-show="show">
    <div class="loading_container">
      <div class="loading_wrapper">
        <img src="../../assets/1.gif" />
        <div>{{ this.option.title }}</div>
        <button @click="close">确定</button>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      show: false,
      title: "正在加载中...",
      option: {
        title: "11111",
        content: "",
        confirm: () => {
          this.close();
        },
      },
    };
  },
  methods: {
    close() {
      this.show = false;
      this.option.confirm();
    },
  },
};
</script>

<style scoped lang="scss">
.loading_cover_container {
  width: 100vw;
  height: 100vh;
  position: fixed;
  left: 0px;
  top: 0px;
  background-color: rgba(0, 0, 0, 0.4);
}
.loading_container {
  width: 100%;
  height: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}
.loading_wrapper {
  width: 200px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  img {
    width: 90px;
  }
  div {
    margin-top: 10px;
    width: 100%;
    font-size: 20px;
    font-weight: 700;
    display: inline-flex;
    justify-content: center;
    align-items: center;
  }
}
</style>